1. Field of the Invention
The present invention generally relates to flow control methods and apparatuses thereof, and more particularly to a flow control method of a network transmitting a variable-size frame and an apparatus thereof.
2. Description of the Related Art
At an input/output of a network such as a carrier network, it is common to arrange an apparatus having a flow control mechanism such as a policer (Policer) for restricting traffic being sent from a user to a network, a shaper (Shaper) for adjusting data to send from the network to the user, and a like.
As a policing method for a frame, RFC2697 “A Single Rate Three Color Marker”, RFC2698 “A Two Rate Three Color Marker”, and a like are offered.
In any case, as shown in FIG. 1, dual token buckets P and C are provided, a rate of flow of a frame passing through the dual token buckets P and C are measured, and a marking is conducted to the frame with any one of green, yellow, and red. In addition, there are two modes: a color blind (Color-Blind) mode which ignores an added color by the marking conducted until a previous stage, and a color aware (Color-Aware) mode which considers the added color.
In RFC2698, two rates are set, and the marking is conducted by using each of the two rates and a burst allowed value as parameters. As one example, an operation of the policer in the color blind mode of RFC2698 will be described. First, parameters in RFC2698 are a PIR (Peak Information Rate: peak rate), a PBS (Peak Burst Size: burst volume allowed for the PIR, a CIR (Committed Information Rate: rate that guarantees a low discard), and a CBS (Committed Burst Size: burst volume allowed for the CIR).
As shown in FIG. 1, the policer includes the two token buckets P and C. If the two token buckets P and C are not filled up, Tp is incremented by one byte per a 1/PIR time, and Tc is incremented by one byte per a 1/CIR time.
It is assumed that a frame having B bytes in length arrives at a certain time t. At this time, as shown in FIG. 2, if Tp(t)−B<0, the frame is marked with red.
Moreover, as shown in FIG. 3, if Tp(t)−B≧0 and Tc(t)−B<0, the frame is marked with yellow and Tp is decremented by only B bytes.
Furthermore, as shown in FIG. 4, if Tp(t)−B≧0 and Tc(t)−B≧0, the frame is marked with green, and both Tp and Tc are decremented by only B bytes.
When each of frames marked as above described is queued into a buffer, a priority is defined to discard the frames. For example, in this buffer, a first threshold is defined for a red frame, a second threshold is defined for a yellow frame, and a third threshold is defined for a green frame. Red input frames are not buffered and are discarded when a queue length in the buffer exceeds the first threshold, the red input frames and yellow input frames are discarded when the queue length in the buffer exceeds the second threshold, all red, yellow, and green input frames are discarded when the queue length of the buffer exceeds the third threshold.
In addition, for example, there is an invention described in a patent reference 1 as an invention that is a method for interfacing to an adjacent high speed data communication network and compresses by eliminating a gap among packets.
Patent Reference 1
Japanese Laid-open Patent Application No. 2001-274824
As described above, in general, the policer and the shaper determine a policing and a shaping based on a length of the frame. For example, in a case of a LAN (including a WAN and a MAN in portions describing the LAN in the specification of the present application) such as Ethernet™, a frame length means a length from an destination address (Destination Address) to FCS (Frame Check Sequence).
However, in the LAN, a preamble being 8 bytes is additionally provided at a head of a frame. In addition, a minimum IFG (Inter Frame Gap: gap between frames) is always inserted among the frames. Since a LAN frame is a variable length, a ratio of overhead portions to a physical line rate varies depending on a length of a frame body.
For example, a case of sending data at a full wire rate via a 10Base-T is considered. In this case, if a frame is the shortest frame being 64 bytes entirely, as shown in FIG. 5(A), a transmission rate (frame rate) at a frame level is shown as 10 Mb/s×64 bytes/(64+8+12 bytes)≈7.62 Mb/s.
On the other hand, if the frame is the longest frame being 1518 bytes entirely, as shown in FIG. 5(B), the frame rate is shown as 10 Mb/s×1518 bytes/(1518+8+12 bytes)≈9.87 Mb/s.
As described above, since the frame rate varies depending on the frame length even if the frame is sent at the same physical line speed, when the policing or the shaping is conducted as conventionally conducted, it is difficult to conduct a precise flow control and also an operation and a network design becomes complicated.
In practice, in a case in that 10 Mb/s at the LAN level is made in an agreement, when a policing rate at the policer is set to be 7.62 Mb/s and all packets sent from a user are frames being 1518 bytes, a transmission rate becomes 7.7 Mb/s at the physical line speed even in that each of the frames includes the preamble and the minimum IFG. Hence, a bandwidth settled in the agreement with the user cannot be guaranteed.
However, on the other hand, when the policing rate at the policer is set to be 9.87 Mb/s and all packets sent from the user are frames being 64 bytes, an actual bandwidth in that the preamble and the minimum IFG are additionally provided to the frame is increased up to 12.95 Mb/s. That is, it is required to assume such a case in the network and to always assure the bandwidth sufficiently. As a result, storage efficiency is degraded.
On the other hand, in a carrier network and a like, as shown in FIG. 6, there is a case of adding information which is internally recognized in the network such as a user identification tag used to identify a user, to a frame. In such this network, if there are network apparatuses 11, 12, and 13 additionally providing the user identification tag and a network apparatus 14 conducting the policing as shown in FIG. 7, the user identification tag additionally provided at the carrier network 10 also becomes a subject for the policing. Even if the user keeps the agreement of the rate, a frame may be discarded.
Accordingly, in order to prevent from a frame discard caused by this tag addition, it is required to set a rate of the policing or the shaping to be higher. However, similar to the previously described preamble and minimum IFG, a proportion of the tags is varied depending on the frame length.
For example, in a case of a tag being 4 bytes, if all frames are 64 bytes, as shown in FIG. 8(A), the bandwidth is increased by 6.25%. If all frames are 1518 bytes, as shown in FIG. 8(B), the bandwidth is increased by only approximately 0.26%. As a result, if the bandwidth is increased by only 0.26%, the bandwidth may becomes narrower than the settled bandwidth. On the other hand, if the bandwidth is increased by 6.25%, it is required to assure a bandwidth being more than the settled bandwidth. As a result, a storage design is degraded.
The above-described problems are caused since fixed-length portions are mixed in the frame in a variable-length frame network. That is, a fixed-length portion such as a portion of the preamble and the minimum IFG (20 bytes), and an identification tag (n bytes) exists by one to one for each frame. However, since the frame is the variable length, the proportion of these fixed-length portions changes for each frame. As a result, it becomes impossible to precisely conduct the flow control, and the network design becomes complicated.